
export default class UserInfo{
    constructor(data) {
        return Object.assign(this,data);//合并
    }
    isMan(){
        if(this.idNo != null && this.idNo != ""){
            if(this.idNo.length == 15){
                if (parseInt(this.idNo.substr(14, 1)) % 2 == 1) {
                    return true;
                } else {
                    return false;
                }
            } else if(this.idNo.length == 18){
                if (parseInt(this.idNo.substr(16, 1)) % 2 == 1) {
                    return true;
                } else {
                    return false;
                }
            }
        }
    }
    getBothday(){
        var birthday = "";
        if(this.idNo != null && this.idNo != ""){
            if(this.idNo.length == 15){
                birthday = "19"+this.idNo.substr(6,6);
            } else if(this.idNo.length == 18){
                birthday = this.idNo.substr(6,8);
            }
            birthday = birthday.replace(/(.{4})(.{2})/,"$1-$2-");
        }
        return birthday;
    }

    /**
     * 新版登录吗？
     */
    isNewVersion(){
        return "1.0" === this.accountVersion;
    }
}
